﻿namespace Magic.Core;




/// <summary>
/// 用户管理
/// </summary>
public static class UserManager
{
    /// <summary>
    /// 用户id
    /// </summary>
    public static int UserId => int.Parse(App.HttpContext?.User.FindFirst(ClaimConst.UserId)?.Value??"0");

    /// <summary>
    /// 账号
    /// </summary>
    public static string UserName => App.HttpContext?.User.FindFirst(ClaimConst.UserName)?.Value;
    /// <summary>
    /// 是否管理员
    /// </summary>
    public static bool IsSuperAdmin => App.HttpContext?.User.FindFirst(ClaimConst.AccountType)?.Value== ((int)AccountTypeEnum.SuperAdmin).ToString();

}
